package com.doudoukeji.service.Activity.my.edituser.edituserphone;

import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.doudoukeji.service.Bean.Token;
import com.doudoukeji.service.R;
import com.sanhai.android.mvp.EduActivity;

//行业界面
public class PhoneNumActivity extends EduActivity {
	// topbar部分
	private TextView mTvTitle;

	//当前界面
	private TextView mTvPhoneNum;
	private Button mBtnConfirm;
	private String phoneNum = "";
	private static int EDITOR_PHONENUM = 101;
	
	@Override
	public void setContentLayout() {
		setContentView(R.layout.activity_phonenum);
	}

	@Override
	public void init() {
		// topbar部分
		mTvTitle = (TextView) findViewById(R.id.tv_title);
		mTvTitle.setText("手机号");
		
		//当前界面	
		mTvPhoneNum = (TextView) findViewById(R.id.tv_phone);
		mBtnConfirm = (Button) findViewById(R.id.btn_confirm);
		mBtnConfirm.setOnClickListener(this);

	}

	@Override
	protected void onResume() {
		super.onResume();
		mTvPhoneNum.setText("您当前的手机号码为" + Token.getPhone());
	}

	@Override
	public void onClickEvent(View view) {
		switch (view.getId()) {
		case R.id.btn_confirm:
			Intent intent = new Intent(PhoneNumActivity.this,PhoneNumEditorActivity.class);
			startActivityForResult(intent, EDITOR_PHONENUM);
			break;

		default:
			break;
		}
	}
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		if (requestCode == EDITOR_PHONENUM&&resultCode == RESULT_OK) {
			PhoneNumActivity.this.finish();
		}
		super.onActivityResult(requestCode, resultCode, data);
	}

	
}
